# -*- coding: utf-8 -*-
from django import forms


class EditPasswordForm(forms.Form):
    current_password = forms.CharField(max_length=64)
    password = forms.CharField(max_length=64)
    repeat_password = forms.CharField(max_length=64)

    def clean_repeat_password(self):
        data = self.cleaned_data
        if not data.get('password') == data.get('repeat_password'):
            raise forms.ValidationError("Пароли должны совпадать")

class EditAvatarForm(forms.Form):
    avatar = forms.FileField()

class EditProfileForm(forms.Form):
    username = forms.CharField(max_length=64)
    first_name = forms.CharField(max_length=64, required=False)
    last_name = forms.CharField(max_length=64, required=False)


